#ifndef POOLALLOCATOR_H
#define POOLALLOCATOR_H
#define DEFAULT_ALLOC_SIZE 1000000
struct AllocInfo
{
	size_t		size;
	AllocInfo*	next;
};
class PoolAllocator
{
public:
	PoolAllocator(void);

	~PoolAllocator(void);

	void* Allocate(size_t size); // Returns 0 if failed to allocate
	void Free(void* ptr);
	void FreeAll(void);

	size_t GetAllocatedSpace(void) const;
	size_t GetTotalSize(void) const;


	friend class PoolAllocIterator;
private:
	char*			m_pBaseAddress;
	size_t			m_size;
	size_t			m_allocated;
	AllocInfo*		m_pFirstAlloc;

};
#endif